﻿using System;
using Assist;
using Autodesk.Revit.DB;

namespace ColumnModuleAndEdit.ColumnModule
{
	public class ColumnDatum
	{
		public ColumnDatum()
		{
			this.colSym = null;
			this.bottomOffset = 0.0;
			this.topOffset = 0.0;
			this.xOffset = 0.0;
			this.yOffset = 0.0;
			this.angle = 0.0;
			this.autoRotate = true;
			this.autoRotateWall = false;
			this.level = null;
			this.idTopLevel = null;
			this.anchorPoint = 0;
			this.width = 0.0;
			this.depth = 0.0;
		}

		public void InitDatum()
		{
			this.colSym = null;
			this.bottomOffset = 0.0;
			this.topOffset = 0.0;
			this.xOffset = 0.0;
			this.yOffset = 0.0;
			this.angle = 0.0;
			this.autoRotate = true;
			this.level = null;
			this.idTopLevel = null;
			this.anchorPoint = 0;
			this.width = 0.0;
			this.depth = 0.0;
		}

		public void ConvertUnit(bool mmToFeet)
		{
			if (mmToFeet)
			{
				this.bottomOffset = AssistFunc.mmToFeet(this.bottomOffset);
				this.topOffset = AssistFunc.mmToFeet(this.topOffset);
				this.xOffset = AssistFunc.mmToFeet(this.xOffset);
				this.yOffset = AssistFunc.mmToFeet(this.yOffset);
				return;
			}
			this.bottomOffset = AssistFunc.feetToMM(this.bottomOffset);
			this.topOffset = AssistFunc.feetToMM(this.topOffset);
			this.xOffset = AssistFunc.feetToMM(this.xOffset);
			this.yOffset = AssistFunc.feetToMM(this.yOffset);
		}

		public FamilySymbol colSym;

		public double bottomOffset;

		public double topOffset;

		public double xOffset;

		public double yOffset;

		public double angle;

		public bool autoRotate;

		public bool autoRotateWall;

		public Level level;

		public ElementId idTopLevel;

		public int anchorPoint;

		public double width;

		public double depth;
	}
}
